package com.dmai.capacity.platform.oauth.common.mapper;

import com.dmai.capacity.platform.common.dto.GatewayLogGroupResult;
import com.dmai.capacity.platform.common.model.GatewayLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @author
 * @email
 * @date 2024-03-26 21:17:04
 */
@Mapper
public interface GatewayLogDao {

    int save(GatewayLog gatewayLog);

    GatewayLog findById(@Param("traceId") String traceId);

    GatewayLogGroupResult findUserCapability(@Param("userid") Integer userid, @Param("clientId") String clientId, @Param("capabilityId") Integer capabilityId, @Param("requestStartTime") String requestStartTime, @Param("requestEndTime") String requestEndTime);

    List<GatewayLogGroupResult> groupByUserCapability(@Param("requestStartTime") String requestStartTime, @Param("requestEndTime") String requestEndTime);

    int update(@Param("traceId") String traceId, @Param("responseTime") Date responseTime, @Param("responseCode") Integer responseCode, @Param("responseData") String responseData, @Param("executeTime") Date executeTime, @Param("handleResult") Integer handleResult);

}
